package com.jt.redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisDataSource {
    private static final JedisPool jedisPool;
    private static String host = "192.168.126.129";
    private static int port = 6379;
    static {
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxTotal(16);
        config.setMaxIdle(60);
        jedisPool= new JedisPool(config,host,port);
    }
    public static Jedis getConnection(){
        return jedisPool.getResource();
    }


}
